﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLNS_Public;
using System.Data;


namespace QLNS_Data
{
   public class Quyen_Data
    {
       KetNoiCSDL_Data kn = new KetNoiCSDL_Data();

       public DataTable LayDuLieu()
       {
           return kn.LayDuLieu("Load_tbl_Quyen");
       }
       public int update_Quyen(Quyen_Public maQuyen, Quyen_Public tenQuyen)
       {
           int n = 2;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@MaQuyen";
           value[0] = maQuyen.MaQuyen;
           name[1] = "@TenQuyen";
           value[1] = tenQuyen.TenQuyen;
           return kn.update("Update_Quyen",name,value,n);
       }
       public int insert_Quyen(Quyen_Public tenQuyen)
       {
           int n = 1;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@TenQuyen";
           value[0] = tenQuyen.TenQuyen;
           return kn.update("Insert_Quyen", name, value, n);
       }
       public int delete_Quyen(Quyen_Public maQuyen)
       {
           int n = 1;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@MaQuyen";
           value[0] = maQuyen.MaQuyen;
           return kn.update("Delete_Quyen", name, value, n);
       }
    }
}
